package com.bw.mallshop.bind;

import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.databinding.BindingAdapter;
import com.bw.common.network.LoadImag;
import com.bw.mallshop.R;
import com.bw.mallshop.entity.SecKillEntity;

public class SkillBind {

    @BindingAdapter("entity")
    public static void skillBind(LinearLayout linearLayout, SecKillEntity.Value entity){
        ImageView value_head_img = linearLayout.findViewById(R.id.value_head_img);
        TextView value_head_title = linearLayout.findViewById(R.id.value_head_title);
        TextView value_head_dec = linearLayout.findViewById(R.id.value_head_dec);
        ImageView skill_value_img1 = linearLayout.findViewById(R.id.skill_value_img1);
        ImageView skill_value_img2 = linearLayout.findViewById(R.id.skill_value_img2);
        ImageView skill_value_img3 = linearLayout.findViewById(R.id.skill_value_img3);
        skill_value_img3.setVisibility(View.GONE);
        LoadImag.loadMatchImg(value_head_img,entity.goods_default_icon);
        value_head_title.setText(entity.goods_default_sku);
        value_head_dec.setText(entity.goods_desc);
        LoadImag.loadMatchImg(skill_value_img1,entity.goods_detail_one);
        LoadImag.loadMatchImg(skill_value_img2,entity.goods_detail_two);
    }

}
